Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace lib:/// scheme by mvn:/// and file:/// and jar+file:/// everywhere #1969

Merged
merged 93 commits into from
Feb 26, 2025

Conversation

jurgenvinju
Copy link
Member

@jurgenvinju jurgenvinju commented Jun 10, 2024

This PR:

  • removes the implementation and use of the lib:/// scheme. This also removes a lot of printing on stderr.
  • builts on the introduction of the mvn:/// scheme
  • moves the original resolution code from the lib:/// scheme implementation to PathConfig.createProjectConfig...
  • adds path resolution error messages and warnings to a PathConfig field called messages, including version clashes on the rascal and rascal-lsp project, missing pom.xml files, etc.
  • changes all clients of PathConfig.createProjectConfig to pretty print resolved paths and error messages.

These were the TODO's:

  • shorten all paths into the local maven repo to mvn:///groupid!artifactid!version
  • replace lib:/// in the processing of dependencies (Require-Libraries) with other schemes, including mvn, file, and jar+file. This means sometimes dynamically computing an absolute path rather than leaving it to an opaque scheme.
  • remove Require-Libraries implementation (is replaced by mvn dependency:list and bundle dependencies in Eclipse)
  • remove lib resolver from the implementation
  • test, test, test
  • figure out how the rascal summaries for the IDE can work without the lib:/// scheme that is now introduced by the Packager. Some form of relocation is necessary, but it can't be the old lib:/// scheme anymore.

This fixes #1916, #1961, #1826, #1825, #1824, #1777, #1767, and #1478

Downstream projects like rascal-lsp and rascal-maven-plugin may need some modifications:

  • In particular everywhere we use URIUtil.correctLocation("lib", name) should become PathConfig.resolveDependencyFromResourcesOnCurrentClasspath("name") or URIUtil.correctLocation("mvn", etc.)
  • Where we receive a new PathConfig instance we can chose to register or print the diagnostic messages.

Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 30.90129% with 322 lines in your changes missing coverage. Please review.

Project coverage is 50%. Comparing base (04a5cbb) to head (a53f908).
Report is 96 commits behind head on main.

Files with missing lines Patch % Lines
src/org/rascalmpl/library/util/PathConfig.java 29% 182 Missing and 13 partials ⚠️
src/org/rascalmpl/library/Messages.java 53% 23 Missing and 8 partials ⚠️
...rascalmpl/uri/file/MavenRepositoryURIResolver.java 4% 21 Missing ⚠️
...r/lang/rascal/tutor/repl/TutorCommandExecutor.java 0% 20 Missing ⚠️
src/org/rascalmpl/shell/ShellEvaluatorFactory.java 0% 12 Missing ⚠️
...rg/rascalmpl/interpreter/utils/RascalManifest.java 9% 10 Missing ⚠️
src/org/rascalmpl/uri/URIUtil.java 28% 10 Missing ⚠️
src/org/rascalmpl/shell/CommandOptions.java 0% 5 Missing ⚠️
src/org/rascalmpl/library/util/Reflective.java 33% 3 Missing and 1 partial ⚠️
src/org/rascalmpl/interpreter/Evaluator.java 0% 2 Missing and 1 partial ⚠️
... and 6 more
Additional details and impacted files
@@           Coverage Diff           @@
##              main   #1969   +/-   ##
=======================================
  Coverage       49%     50%           
- Complexity    6575    6587   +12     
=======================================
  Files          698     699    +1     
  Lines        60706   60711    +5     
  Branches      8875    8886   +11     
=======================================
+ Hits         30345   30425   +80     
+ Misses       28122   28030   -92     
- Partials      2239    2256   +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jurgenvinju
Copy link
Member Author

jurgenvinju commented Jun 27, 2024

tests to run

  • rascal project tests
  • flybytes project (lots of Java jar dependencies)
  • salix project
  • drambiguity project (depends on salix)

@jurgenvinju
Copy link
Member Author

This PR fixes #1961

Copy link
Member

@DavyLandman DavyLandman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small comments.

…wn class to avoid cyclic static block dependencies
…the stdlib resolver by removing a call to mavenize. tricky business.
…ad projects from a common workspace folder, to be able to deal with the typepal source dependency of the rascal project
…rs to read projects from a common workspace folder, to be able to deal with the typepal source dependency of the rascal project"

This reverts commit 7c77df9.
…endency cycle is introduced, and fixed a number of minor issues
…ndency to typepal to a version that has rascal itself provided to avoid loading an older vallang via that route
… This can happen in case of diamond dependencies of open Rascal projects in the IDE
@DavyLandman DavyLandman merged commit bf583ae into main Feb 26, 2025
6 of 7 checks passed
@DavyLandman DavyLandman deleted the replace-lib-by-mvn-and-others branch March 10, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New mvn scheme to replace lib scheme.
3 participants